import { createStore } from 'vuex';
export default createStore({
  state: {
    token: '',
	name:''
  },
  mutations: {
    setToken(state, token) {
      state.token = token;
      localStorage.setItem('token', token);
	  
    },
	setName(state,name){
		state.name=name;
		localStorage.setItem('name',name)
	},
	setId(state,id){
		state.id=id;
		localStorage.setItem('id',id)
	},
	setType(state,type){
		state.type=type;
		localStorage.setItem('utype',type)
	},
    removeToken(state) {
      state.token = '';
	  state.name=''
      localStorage.removeItem('token');
	  localStorage.removeItem('name')
    },
  },
  actions: {
  },
  getters: {
  },
});